<?xml version="1.0" encoding="utf-8"?>
<Content type="xform" name="EditContent">
  <model>
    <instance>
      <tblContent>
        <nContentKey/>
        <nContentPrimaryId/>
        <nVersion/>
        <cContentForiegnRef/>
        <cContentName>ActivationCode</cContentName>
        <cContentSchemaName>xform</cContentSchemaName>
        <cContentXmlBrief>
          <Content type="xform" name="ActivationCode" subType="ActivationCodeXform">
            <model>
              <instance>
                <RegistrationCode/>
                <RedirectPage/>
                <Codeset/>
                <SuccessMessage>
                  <h2>Activation Code Successful</h2>
                  <p>The activation code was applied successfully.</p>
                </SuccessMessage>
              </instance>
              <submission id="activate" action="" method="post" event="return form_check(this)"/>
              <bind id="RegistrationCode" nodeset="RegistrationCode" required="true()" type="string"/>
            </model>
            <group ref="EditContent" class="1Col">
              <label>Enter your Activation Code</label>
              <input bind="RegistrationCode" class="required">
                <label>Code</label>
              </input>
              <input class="ie-one-element-bodge"/>
              <submit submission="activate" ref="ewSubmit" class="principle">
                <label>Activate</label>
              </submit>
            </group>
          </Content>
        </cContentXmlBrief>
        <cContentXmlDetail/>
        <nAuditId/>
        <nAuditKey/>
        <dPublishDate/>
        <dExpireDate/>
        <dInsertDate/>
        <nInsertDirId/>
        <dUpdateDate/>
        <nUpdateDirId/>
        <nStatus>1</nStatus>
        <cDescription/>

      </tblContent>
    </instance>
    <submission id="EditContent" action="" method="post" event="return form_check(this)"/>
    <bind id="cContentName" nodeset="tblContent/cContentName" required="true()" type="string"/>
    <bind id="dPublishDate" nodeset="tblContent/dPublishDate" required="false()" type="string"/>
    <bind id="dExpireDate" nodeset="tblContent/dExpireDate" required="false()" type="string"/>
    <bind id="nStatus" nodeset="tblContent/nStatus" required="true()" type="string"/>
    <bind id="cDescription" nodeset="tblContent/cDescription" required="false()" type="string"/>
    <bind id="bCascade" nodeset="tblContent/bCascade" required="false()" type="string"/>
    <bind id="cFormTitle" nodeset="tblContent/cContentXmlBrief/Content/group/label" required="true()" type="string"/>
    <bind nodeset="tblContent/cContentXmlBrief/Content/model/instance">
      <bind id="Codeset" nodeset="Codeset" required="false()" type="format:^\s*((\d+)(\s*,\s*(\d+))*)?\s*$">
        <alert type="type">The codeset must be empty or a comma separated list of numbers</alert>
      </bind>
      <bind id="RedirectPage" nodeset="RedirectPage" required="false()" type="string"/>
      <bind id="SuccessMessage" nodeset="SuccessMessage" required="true()" type="string"/>
    </bind>
  </model>
  <group ref="EditContent" class="2col">
    <label>Edit Activation Code Form</label>
    <group>
      <group>
        <input bind="nContentKey" class="hidden">
          <label>ContentId</label>
        </input>
        <label>Settings</label>
        <input bind="cContentName" class="hidden">
          <label>Text Location</label>
        </input>
        <input bind="dPublishDate" class="calendar short">
          <label>Publish Date</label>
        </input>
        <input bind="dExpireDate" class="calendar short">
          <label>Expire Date</label>
        </input>
        <select1 bind="nStatus" appearance="full" class="required vshort">
          <label>Status</label>
          <item>
            <label>Live</label>
            <value>1</value>
          </item>
          <item>
            <label>Hidden</label>
            <value>0</value>
          </item>
        </select1>
        <select bind="bCascade" appearance="full">
          <label>Cascade to Child Pages</label>
          <item>
            <label/>
            <value>true</value>
          </item>
        </select>
        <input bind="cDescription" class="short">
          <label>Change Notes</label>
        </input>
      </group>

      <group>
        <label>Form Details</label>
        <input bind="cFormTitle" class="required short">
          <label>Form Title</label>
        </input>
        <select1 bind="RedirectPage" class="siteTree">
          <label>Redirect Page</label>
          <hint>On succesful activation, optionally redirect the user to another page.</hint>
        </select1>
        <input bind="Codeset" appearance="minimal" class="codesetlist short">
          <label>Codeset</label>
          <hint>Optional, a comma separated list of codeset IDs to limit this form by.</hint>
        </input>

        <group>
          <label>Message on Registration</label>
          <textarea bind="SuccessMessage" class="TextArea xhtml required" rows="40" cols="70">
          </textarea>
        </group>
      </group>

      <submit submission="SaveForm" ref="ewSubmit" class="principle">
        <label>Save Form</label>
      </submit>
    </group>
  </group>
</Content>
